// 云函数入口文件
const cloud = require('wx-server-sdk');
// console.log('cloud:', cloud);
// console.log('wx.cloud:',wx.cloud);
cloud.init();

// 云函数入口函数
exports.main = async (event, context) => {
  const fileID = 'cloud://kfm-b9a853.6b66-kfm-b9a853/my-image.jpg';
  const res = await cloud.downloadFile({
    fileID: fileID
  });
  const buffer = res.fileContent
  return buffer.toString('utf8');
}